const userModel = require("../models/admin_model");

// 登录   
function doLogin(user, onRetGot, onErrGot) {
    // onErrGot({ msg: "登录失败" });
    userModel.login(
        user,
        (ret) =>
            onRetGot(
                ret ? { ret, msg: "登录成功" ,code:200,authorization:"adsaskdjasf54654k"} : { msg: "用户名或密码错误" ,code:400}
            ),
        (err) => onErrGot({ err, msg: "登录失败" ,code:200})
    );
}






const userController = {
    doLogin,
};

module.exports = userController;
